﻿@{
    Layout = null;
}
    <script type="text/javascript">

    document.getElementById('ajax_submitBtn').onclick = submitlogin;
    document.getElementById('ajax_validatecodeimg').onclick = changevalidatecodeimg;

    function changevalidatecodeimg()
    {
        var append = '?' + new Date().getTime() + 'a' + Math.random();
        $(this).attr('src', $(this).attr('src') + append);
        return false;
    }

    function submitlogin()
    {
        var userName = $("#ajax_userName").val();
                var pwd = $("#ajax_password").val();
                var validCode = $("#ajax_validatecode").val();
                //var remember = $("#remember").val();
                var remember = "";

                params = '{userName:"' + userName + '",pwd:"' + pwd + '",validCode:"' + validCode + '",remember:"' + remember + '"}';
                $.ajax({
                    type: "POST",
                    cache: false,
                    url: "@Url.Action("AjaxLogIn", "Widget")",
                    data: params,
                    dataType: "html",
                    contentType: "application/json; charset=utf-8",
                    beforeSend: function(){
                    },
                    success: function (result) {
                        $("#common_dialog_c").html(result);
                    },
                    error: function (xhr, msg, e) {
                        alert(msg);
                    }
                });
    }
</script>

<div class="user" id="ajax_user_widget">
    
    <div class="user_list" id="ajax_user_list">
        <div class="user_list_bg">
            <div class="dl-usr">
                <table>
                    <tbody>
                        <tr>
                            <td class="l">
                                会员帐号
                            </td>
                            <td>
                                <input name="userName" id="ajax_userName" type="text" class="" onkeyup="return EnterSubmit(event);"
                                    onfocus="this.className='on'" onblur="this.className=''" />
                            </td>
                        </tr>
                        <tr>
                            <td class="l">
                                会员密码
                            </td>
                            <td>
                                <input name="password" id="ajax_password" type="password" class="" onkeydown="EnterSubmit(event);"
                                    onfocus="this.className='on'" onblur="this.className=''" maxlength="30" />
                            </td>
                        </tr>
                        <tr>
                            <td class="l">
                                验证码
                            </td>
                            <td>
                                <input name="validatecode" id="ajax_validatecode" type="text" class="validatecode" />
                                <img id="ajax_validatecodeimg" src="@Url.Action("GetValidateCode", "Widget")" alt="hip code" title="看不清？点击换一张" onclick="changevalidatecodeimg()" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <a href="/user/forgotpwd">？找回密码</a>
                            </td>
                        </tr>
                        @*<tr>
                                <td class="l">
                                </td>
                                <td>
                                    <label>
                                        <input name="remember" id="remember" type="checkbox" class="remember" />下次记住我</label>
                                </td>
                            </tr>*@
                    </tbody>
                </table>
                <div class="join-usr">
                    @Html.ActionLink("会员注册", "Register", "Customer", null, new { @class = "ui-icons join_position demo_button" })
                    @*                        <input name="userJoin" id="userJoin" type="button" class="ui-icons join_position demo_button"
                            value="会员注册" />*@
                    <input name="submitBtn" id="ajax_submitBtn" type="button" class="ui-icons submit_position demo_button"
                        value="登 录" onclick="submitlogin" />
                </div>
            </div>
        </div>
    </div>
</div>

